The methods for simulating magnetic flux leakage in defect detection can be categorized into analytical method based on magnetic dipole model and finite element method (FEM) based on Maxwell's equations. However, both methods have certain limitations. For instance, the analytical method based on magnetic dipole model omits the nonlinear magnetization of ferromagnetic material and the geometric parameters of defect, and the results of magnetic dipole model are highly dependent on the setting of magnetic dipole distribution, which leads to unsuitability for complex defect. As for the FEM, it can't get the functional relationship between the magnetic flux leakage signal and the shape of defect, and the calculation process of FEM is highly dependent on meshing, thus high-precision calculation will consume considerable computing resources and time.